﻿<%@ Page Language="C#" MasterPageFile="~/MasterPages/AdminMaster.master" AutoEventWireup="true"
    CodeFile="UserMaster.aspx.cs" Inherits="Admin_UserMaster" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <table style="width: 100%" id="TABLE1" cellspacing="1" cellpadding="1" border="0">
        <tbody>
            <tr>
                <td style="height: 30px; text-align: center" colspan="3">
                    <table id="TABLE3" border="0">
                        <tbody>
                            <tr>
                                <td colspan="9" style="text-align: left;">
                                    <h2>User Master</h2>
                                </td>
                            </tr>
                            <tr>
                                <%--<td style="vertical-align: middle;" align="right" class="auto-style3">
                                            User Name&nbsp;
                                        </td>--%>
                                       <%-- <td style="width: 100px;vertical-align: middle;">
                                            <asp:TextBox ID="txtUserName" runat="server" Width="139px" MaxLength="50">
                                            </asp:TextBox></td>--%>
                                        <td style="vertical-align: middle;" align="right" class="auto-style6">
                                            &nbsp;Email Id / Name&nbsp;&nbsp;:&nbsp;&nbsp;
                                        </td>
                                        <td style="width: 100px;vertical-align: middle;">
                                            <asp:TextBox ID="txtUserId" runat="server" Width="139px" MaxLength="50">
                                            </asp:TextBox></td>
                                        <td style="vertical-align: middle;white-space:nowrap;" align="right" class="auto-style4">
                                            Role Name&nbsp;&nbsp;:&nbsp;&nbsp;
                                        </td>
                                        <td style="width: 100px;vertical-align: middle;">
                                             <asp:DropDownList ID="ddlRoles" runat="server"  Width="200px" MaxLength="50">                               
                                                 <%--<asp:ListItem>Super User</asp:ListItem>
                                                 <asp:ListItem>Global Director</asp:ListItem>
                                                 <asp:ListItem>Regional Director</asp:ListItem>
                                                 <asp:ListItem>Country Head</asp:ListItem>
                                                 <asp:ListItem>Country Manager</asp:ListItem>
                                                 <asp:ListItem>Assessor-Research Lead</asp:ListItem>
                                                 <asp:ListItem>Assessor - Moderator</asp:ListItem>
                                                 <asp:ListItem>Auditor</asp:ListItem>
                                                 <asp:ListItem>Industry Expert</asp:ListItem>
                                                 <asp:ListItem>Candidate</asp:ListItem>
                                                 <asp:ListItem>IQ-KS Admin</asp:ListItem>
                                                 <asp:ListItem>IQ-KS Users</asp:ListItem>     --%>                         
                            </asp:DropDownList>
                                            </td>
                                <td align="left" class="auto-style2">&nbsp;
                                            <asp:Button ID="btnSearch" OnClick="BtnSearch_OnClick" runat="server"
                                                Text="Search" CausesValidation="false"></asp:Button></td>
                                <td  class="auto-style5" align="left">
                                            <asp:Button ID="btnClear" OnClick="BtnClear_OnClick" runat="server"
                                                Text="Clear" CausesValidation="false" Width="92px"></asp:Button></td>
                                <td style="width: 18%; text-align: right" align="right">
                                    <asp:Button ID="btnAddNew" OnClick="btnAddNew_OnClick" runat="server"
                                        Text="Add New User" CausesValidation="false"></asp:Button></td>
                            </tr>
                        </tbody>
                    </table>
                </td>
            </tr>
            <tr>
                <td align="center" colspan="3">
                    <div class="grd_table" style="overflow-x: auto; width: 950px">

                        <asp:GridView ID="gvSearchResult" runat="server" OnRowEditing="gvSearchResult_OnRowEditing" OnRowDeleting="gvSearchResult_RowDeleting"                           
                            OnPageIndexChanging="gvSearchResult_OnPageIndexChanging" OnRowCommand="gvSearchResult_OnRowCommand" OnRowDataBound="gvSearchResult_RowDataBound"
                            PageSize="10" AllowPaging="true" Width="100%"
                            AutoGenerateColumns="false">
                            <Columns>
                                <%--<asp:BoundField DataField="User_Name" HeaderText="User Name">
                                    <ItemStyle Width="15%" HorizontalAlign="Left" />
                                    <HeaderStyle HorizontalAlign="Left" />
                                </asp:BoundField>--%>
                                 <asp:BoundField DataField="roletitle" HeaderText="Role Name">
                                    <ItemStyle Width="20%" HorizontalAlign="Left" />
                                    <HeaderStyle HorizontalAlign="Left" />
                                </asp:BoundField>
                                <asp:BoundField DataField="fullname" HeaderText="Full Name">
                                    <ItemStyle Width="25%" HorizontalAlign="Left" />
                                    <HeaderStyle HorizontalAlign="Left" />
                                </asp:BoundField>   
                                <asp:BoundField DataField="email" HeaderText="Email ID">
                                    <ItemStyle Width="25%" HorizontalAlign="Left" />
                                    <HeaderStyle HorizontalAlign="Left" />
                                </asp:BoundField>                             
                               <%-- <asp:TemplateField HeaderText="Is Approved" ItemStyle-VerticalAlign="Middle">
                                    <ItemTemplate>
                                        <input type="checkbox" runat="server" readonly="readonly" id="chkIsActive" checked='<%# Eval("isapproved") %>' onclick="return false" enableviewstate="true" />
                                    </ItemTemplate>
                                    <ItemStyle Width="10%"  HorizontalAlign="Center" />
                                </asp:TemplateField>--%>
                                <%--<asp:TemplateField>
                                    <ItemTemplate>
                                        <asp:LinkButton ID="lnkEdit" runat="server" CausesValidation="false" CommandName="Edit"
                                            CommandArgument='<%# Eval("userid") %>'>Edit</asp:LinkButton>
                                    </ItemTemplate>
                                    <ItemStyle Width="5%" />
                                </asp:TemplateField>--%>
                                <asp:HyperLinkField DataNavigateUrlFields="userid" DataNavigateUrlFormatString="~/Admin/UserMasterModify.aspx?userid={0}&mod=up"
                            HeaderText="Edit" Text="Edit" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="left"/>
                                 <asp:TemplateField HeaderText="Delete">
                                      <ItemStyle Width="15%" HorizontalAlign="left" />
                                 <ItemTemplate>
                                   <asp:LinkButton ID="lnkDelete" CommandArgument='<%# Eval("userid") %>' CommandName="Delete" runat="server"><%# Convert.ToBoolean(Eval("isapproved")) == false ? "Activate" : "Delete"%></asp:LinkButton>
                                 </ItemTemplate>
                               </asp:TemplateField>
                                <asp:TemplateField HeaderText="Reset">
                                      <ItemStyle Width="15%" HorizontalAlign="left" />
                                 <ItemTemplate>
                                   <asp:LinkButton ID="lnkReset" CommandArgument='<%# Eval("userid") %>' CommandName="Reset" runat="server"><%# Convert.ToBoolean(Eval("isapproved")) == false ? "Reset" : "Reset"%></asp:LinkButton>
                                 </ItemTemplate>
                               </asp:TemplateField>
                            </Columns>
                             <FooterStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#E2DED6" ForeColor="blue" HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                    <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
                    <EditRowStyle BackColor="#CCCCCC" />
                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                        </asp:GridView>
                    </div>
                </td>
            </tr>
            <tr>
                <td align="right" colspan="3"></td>
            </tr>
        </tbody>
    </table>
</asp:Content>
<asp:Content ID="Content2" runat="server" ContentPlaceHolderID="head">
    <style type="text/css">
        .auto-style2 {
            width: 114px;
        }

        .auto-style4 {
            width: 90px;
        }
        .auto-style5 {
            width: 101px;
        }
        .auto-style6 {
            width: 229px;
        }
    </style>
</asp:Content>

